import request from "./request";
import type {
  submitDataType,
  goLoginType,
  taocanPriceType,
} from "@/dataType/data";

//封装首页接口
export const getHomeApi = () => {
  return request({
    url: "frontpage",
    method: "GET",
  });
};

//新冠疫苗预约时段接口
export const getXinGuanInfoApi = () => {
  return request({
    url: "newapptime ",
    method: "GET",
  });
};

//提交新冠疫苗预约接口
export const submitXinGuanYuYueApi = (data: submitDataType) => {
  return request({
    url: "rescovid",
    method: "POST",
    data,
  });
};

//登录接口
export const goLoginApi = (data: goLoginType) => {
  return request({
    url: "wx_login",
    method: "POST",
    data,
  });
};

//获取新冠预约订单列表
export const getXinGuanOrderListApi = () => {
  return request({
    url: "coviduser_order",
    method: "GET",
  });
};

//取消新冠预约订单列表
export const cancelXinGuanOrderApi = (_id: string) => {
  return request({
    url: "covidcancel",
    method: "GET",
    data: { _id },
  });
};

//获取hpv预约列表
export const getHpvListApi = () => {
  return request({
    url: "otuhpv",
    method: "GET",
  });
};

//获取hpv套餐列表
export const getTaoCanListApi = () => {
  return request({
    url: "hpv_pack",
    method: "GET",
  });
};

//获取hpv套餐价格接口
export const getTaoCanPriceApi = (data: taocanPriceType) => {
  return request({
    url: "hpv_price",
    method: "POST",
    data,
  });
};

//获取就诊人列表
export const get_patientApi = () => {
  return request({
    url: "get_patient",
    method: "GET",
  });
};

//获取抑郁症题目
export const get_depression_topicsApi = () => {
  return request({
    url: "depression_topics",
    method: "GET",
  });
};

//获取抑郁症题目结果
export const get_depressionApi = (value: string[]) => {
  return request({
    url: "depression",
    method: "GET",
    data: { value },
  });
};

//获取早泄题目
export const get_premature_topicsApi = () => {
  return request({
    url: "premature_topics",
    method: "GET",
  });
};

//获取早泄题目结果
export const get_prematureApi = (value: string[]) => {
  return request({
    url: "premature",
    method: "GET",
    data: { value },
  });
};

// 获取失眠题目
export const get_insomnia_topicsApi = () => {
  return request({
    url: "insomnia_topics",
    method: "GET",
  });
};

// 获取失眠题目结果
export const get_insomniaApi = (value: string[]) => {
  return request({
    url: "insomnia",
    method: "GET",
    data: { value },
  });
};

//获取视频列表
export const getVideoListApi = (page: number) => {
  return request({
    url: "video_list",
    method: "GET",
    data: { page },
  });
};
